/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.workforce.common.tags;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

/**
 *
 * @author neo
 */
public class FieldSubmitTag extends TagSupport {

    protected String label;
    protected String style;

    @Override
    public int doStartTag() throws JspException {
        JspWriter out = pageContext.getOut();
        StringBuffer s = new StringBuffer();
        s.append("<input type=\"submit\" name=\"fsubmit\" value=\"").append(label).append("\"");
        if (style != null) {
            s.append("class=\"").append(style).append("\"");
        }
        s.append(">\n");
        try {
            out.print(s.toString());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return SKIP_BODY;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public void setStyle(String style) {
        this.style = style;
    }
}
